<?php
class Controller_Statistic extends Controller_Action
{
	public function __construct(Controller_Front $frontController)
	{
		parent::__construct('statistic', $frontController);
	}
	
	public function indexAction()
	{
		$criteria = new Criteria();
		$criteria->addDescendingOrderByColumn(NewsPeer::CLICKCOUNTER);
		$criteria->add(NewsPeer::ID_REQUEST_STATUS, Manager_RequestStatus::getDone()->getIdRequestStatus(),
			Criteria::EQUAL);
		$news = NewsPeer::doSelect($criteria);
		
		// FIXME: wyswietlanie najpopulatnijeszych
		$this->assign('news', $news);
		$this->display('statistics.tpl');
	}
}